package com.hulk.tests.controller;

import com.hulk.limitb.annotation.Limitb;
import com.hulk.limitb.enums.LimitType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Huang Hong Fei
 * @createAt 2021/7/20
 * @description
 */
@RestController
public class LimitbController {

    @PostMapping(path="/limitb")
    @Limitb(limitType = LimitType.SIMPLE)
    public Object limitb(){
        return "success";
    }

    @PostMapping(path="/limitbByRedis")
    @Limitb(limitType = LimitType.REDIS,maxCount = 1,seconds = 10)
    public Object limitbByRedis(){
        return "success";
    }
}
